cmake_minimum_required(VERSION 3.10)

project(tensorrt_inference)

find_package(CUDA REQUIRED)
find_package(OpenCV REQUIRED)

set(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
option (USE_NVIDIA ON)


include_directories(/usr/src/tensorrt/samples/common)
include_directories(/home/nvidia/toe_aimbot_2023/detector/jetson_orin)
include_directories(/home/nvidia/toe_aimbot_2023/detector/jetson_orin/mycuda)
include_directories(${CUDA_INCLUDE_DIRS})
include_directories(${OpenCV_INCLUDE_DIRS})
include_directories(/usr/include/aarch64-linux-gnu)
include_directories(/home/nvidia/toe_aimbot_2023/detector)
include_directories(/home/nvidia/toe_aimbot_2023/communicator)
include_directories(/home/nvidia/toe_aimbot_2023/grab)
include_directories(/home/nvidia/toe_aimbot_2023)
include_directories(/opt/MVS/include)

link_directories(/opt/MVS/lib/aarch64)
cuda_add_executable(tensorrt_inference main.cpp 
/home/nvidia/toe_aimbot_2023/detector/detector.cpp 
/home/nvidia/toe_aimbot_2023/detector/parse_config.cpp
/home/nvidia/toe_aimbot_2023/detector/jetson_orin/mycuda/preprocess.cu
/home/nvidia/toe_aimbot_2023/detector/jetson_orin/mycuda/postprocess.cu
/home/nvidia/toe_aimbot_2023/detector/jetson_orin/orin_detect.cpp 
/usr/src/tensorrt/samples/common/logger.cpp
/home/nvidia/toe_aimbot_2023/communicator/my_serial.cpp
/home/nvidia/toe_aimbot_2023/grab/GrabImg.cpp)

target_link_libraries(tensorrt_inference /usr/lib/aarch64-linux-gnu)
target_link_libraries(tensorrt_inference ${CUDA_LIBRARIES})
target_link_libraries(tensorrt_inference ${OpenCV_LIBS})
target_link_libraries(tensorrt_inference nvinfer)
target_link_libraries(tensorrt_inference nvparsers)
target_link_libraries(tensorrt_inference nvonnxparser jsoncpp MvCameraControl)



